package com.pcbly.web.bean.user;

import java.util.Date;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.jbpm.api.identity.User;

import com.pcbly.web.bean.AbstractBaseBean;
import com.pcbly.web.bean.system.RoleBean;

@SuppressWarnings("unchecked")
public class UserBean extends AbstractBaseBean implements User {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1113368498649119690L;

	private String userNo;

	private String userName;
	
	private Date confirmedDate;
	
	private Date terminationDate;
	
	private String business;
	
//	private String businessEmail;//FamilyName,GivenName
	
	private String sex;
	
	private Date birthDay;
	
	private String departmentId;
	
	private Date joinDate;	

	private String nickName;

	private String passwd;

	private String rePasswd;

	private String email;

	private Date regTime;

	private Date loginTime;

	private String loginIP;

	private int loginTimes;

	private Date lastLoginTime;

	private String lastLoginIP;

	private long stayTime;

	private String picFileName;

	private UserDetailBean userDetail;

	private int hiddenLogin;

	private boolean enabled;

	private boolean accountNonExpired;

	private boolean credentialsNonExpired;

	private String userLevel;

	private boolean accountNonLocked;
	
	private String systemFlag; 

	private Set<RoleBean> roles = new HashSet<RoleBean>(0);

	private Set<UserSchoolBean> userSchools = new HashSet<UserSchoolBean>(0);

	private Map properties;

	public String getUserLevel() {
		return userLevel;
	}
	
	
	public String getBusiness() {
		return business;
	}


	public void setBusiness(String business) {
		this.business = business;
	}


	public Date getConfirmedDate() {
		return confirmedDate;
	}


	public void setConfirmedDate(Date confirmedDate) {
		this.confirmedDate = confirmedDate;
	}


	public Date getTerminationDate() {
		return terminationDate;
	}


	public void setTerminationDate(Date terminationDate) {
		this.terminationDate = terminationDate;
	}


	public String getDepartmentId() {
		return departmentId;
	}


	public void setDepartmentId(String departmentId) {
		this.departmentId = departmentId;
	}


	public void setUserLevel(String userLevel) {
		this.userLevel = userLevel;
	}

	public Map getProperties() {
		return properties;
	}

	public void setProperties(Map properties) {
		this.properties = properties;
	}

	public UserBean() {

	}

	public Set<RoleBean> getRoles() {
		return roles;
	}

	public void setRoles(Set<RoleBean> roles) {
		this.roles = roles;
	}

	public Set<UserSchoolBean> getUserSchools() {
		return userSchools;
	}

	public void setUserSchools(Set<UserSchoolBean> userSchools) {
		this.userSchools = userSchools;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public boolean isAccountNonExpired() {
		return accountNonExpired;
	}

	public void setAccountNonExpired(boolean accountNonExpired) {
		this.accountNonExpired = accountNonExpired;
	}

	public boolean isCredentialsNonExpired() {
		return credentialsNonExpired;
	}

	public void setCredentialsNonExpired(boolean credentialsNonExpired) {
		this.credentialsNonExpired = credentialsNonExpired;
	}

	public boolean isAccountNonLocked() {
		return accountNonLocked;
	}

	public void setAccountNonLocked(boolean accountNonLocked) {
		this.accountNonLocked = accountNonLocked;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getPasswd() {
		return passwd;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}

	public String getRePasswd() {
		return rePasswd;
	}

	public void setRePasswd(String rePasswd) {
		this.rePasswd = rePasswd;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getRegTime() {
		return regTime;
	}

	public void setRegTime(Date regTime) {
		this.regTime = regTime;
	}

	public Date getLoginTime() {
		return loginTime;
	}

	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}

	public String getLoginIP() {
		return loginIP;
	}

	public void setLoginIP(String loginIP) {
		this.loginIP = loginIP;
	}

	public int getLoginTimes() {
		return loginTimes;
	}

	public void setLoginTimes(int loginTimes) {
		this.loginTimes = loginTimes;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public String getLastLoginIP() {
		return lastLoginIP;
	}

	public void setLastLoginIP(String lastLoginIP) {
		this.lastLoginIP = lastLoginIP;
	}

	public long getStayTime() {
		return stayTime;
	}

	public void setStayTime(long stayTime) {
		this.stayTime = stayTime;
	}

	public String getPicFileName() {
		return picFileName;
	}

	public void setPicFileName(String picFileName) {
		this.picFileName = picFileName;
	}

	public UserDetailBean getUserDetail() {
		return userDetail;
	}

	public void setUserDetail(UserDetailBean userDetail) {
		this.userDetail = userDetail;
	}

	public int getHiddenLogin() {
		return hiddenLogin;
	}

	public void setHiddenLogin(int hiddenLogin) {
		this.hiddenLogin = hiddenLogin;
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		return EqualsBuilder.reflectionEquals(this, object);
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

	public void setUserNo(String userNo) {
		this.userNo = userNo;
	}

	public String getUserNo() {
		return userNo;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public Date getBirthDay() {
		return birthDay;
	}

	public void setBirthDay(Date birthDay) {
		this.birthDay = birthDay;
	}

	public Date getJoinDate() {
		return joinDate;
	}

	public void setJoinDate(Date joinDate) {
		this.joinDate = joinDate;
	}

	public String getSystemFlag() {
		return systemFlag;
	}

	public void setSystemFlag(String systemFlag) {
		this.systemFlag = systemFlag;
	}

	@Override
	public String getBusinessEmail() {
		// TODO Auto-generated method stub
		return email;
	}
	
	@Override
	public String getFamilyName() {
		// TODO Auto-generated method stub
		return userName;
	}

	@Override
	public String getGivenName() {
		// TODO Auto-generated method stub
		return userName;
	}

}
